
using System;

namespace Graph
{
    public class Knoten
    {
        private int id;
        // Zeiger auf den Vorgänger Knoten beim Graph-Scanning

        public Knoten()
        {
            this.id = 0;
        }

        public Knoten(int id)
        {
            this.id = id;
        }

        public int Id
        {
            get { return this.id; }
        }
    }

    public class DijkstraKnoten : Knoten, IKey
    {
        public int HeapPos;
        public double distance;
        public Knoten predeseccor;

        public DijkstraKnoten()
        {
            distance = Double.MaxValue;
            predeseccor = null;
            HeapPos = 0;
        }

        public DijkstraKnoten(int id)
            : base(id)
        {
            distance = Double.MaxValue;
            predeseccor = null;
            HeapPos = 0;
        }

        public DijkstraKnoten(int id, int Distance, DijkstraKnoten Predeseccor, double Realdist, int X, int Y)
            : base(id)
        {
            distance = Distance;
            predeseccor = Predeseccor;
            HeapPos = 0;

        }

        public double getKey()
        {
            return distance;
        }

        public void setKey(double Key)
        {
            distance = Key;
        }

        public int getHeapPos()
        {
            return HeapPos;
        }

        public void setHeapPos(int Pos)
        {
            HeapPos = Pos;
        }
    }

    public class FlowKnoten : Knoten
    {
        public FlowKnoten(int id)
            : base(id)
        {
            height = -1;
            excess = 0;
        }

        private int height;

        public int Height { get { return height; } set { height = value; } }

        private double excess;

        public double Excess { get { return excess; } set { excess = value; } }
    }
}
